
(function(){
    function get_st_cookie(key){
            var key=key+"=";
            var key_len = key.length;
            var cookie_len = document.cookie.length;
            var start_off = document.cookie.indexOf(key);

            if (start_off == -1) return -1;

            var end_off = document.cookie.indexOf(";", start_off+key_len);

            if (end_off==-1) {
                    end_off = cookie_len;
            }

            return document.cookie.substr(start_off+key_len, end_off-start_off-key_len);
    }

    var expires = new Date();
    var now = parseInt(expires.getTime());
    expires.setTime(now+1000*86400*365);

    var sid = get_st_cookie("sid"); 
    if (sid == -1) sid = "1";

    var uvid = get_st_cookie("uvid");
    if (uvid == -1) uvid = "94b3492872d121d907df350f420ce8e4";

    var st_str = "";
    st_str += "ref=" + encodeURIComponent(document.referrer.substr(0,512));
    st_str += "&p=" + encodeURIComponent(screen.width+'x'+screen.height);
    st_str += "&sid=" + sid;
    st_str += "&uvid=" + uvid;
    st_str += "&lg=" + navigator.systemLanguage;
    st_str += "&t=" + now;

    document.cookie="sid=" + sid +";expires="+expires.toGMTString()+ ";path=/";
    document.cookie="uvid=" + uvid +";expires="+expires.toGMTString()+ ";path=/";    

    document.write('<img src="http://st.61658.com/stat.htm?'+st_str+'" border=0 width=0 height=0 />');
})()
